Featherweight Wrap Java: wrapping objects and methods

نویسندگان

  • Lorenzo Bettini
  • Sara Capecchi
  • Elena Giachino
چکیده

We present a language extension, which integrates in a Java like language a mechanism for dynamically extending object behaviors without changing their type. Our approach consists in moving the addition of new features from class (static) level to object (dynamic) level: the basic features of entities (representing their structure) are separated from the additional ones (wrapper classes whose instances represent run-time added behaviors). At run-time, these entities can be dynamically composed by instantiating wrapper objects which are attached to basic entities. Wrappers permit specializing (wrapping) methods at run-time: the method of the wrapper will be automatically executed after the method of the wrapped objects, using a delegation mechanism. Furthermore, wrapped methods can return values and values returned by the wrapped methods are transparently made available in the wrapper methods. We formalize our extension by adding the new constructs to Featherweight Java and we prove that the core language so extended (Featherweight Wrap Java) is type safe.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Object Incompleteness and Dynamic Composition in Java-Like Languages

Object composition is often advocated as a more flexible alternative to standard class inheritance since it takes place at run-time, thus permitting to specialize the behavior of objects dynamically. In this paper we present Incomplete Featherweight Java (IFJ), an extension of Featherweight Java to incomplete objects, i.e., objects that require some missing methods which can be provided at run-...

متن کامل

Featherweight Java A Minimal Core Calculus for Java and GJ

Several recent studies have introduced lightweight ver sions of Java reduced languages in which complex fea tures like threads and re ection are dropped to enable rigorous arguments about key properties such as type safety We carry this process a step further omitting almost all features of the full language including inter faces and even assignment to obtain a small calculus Featherweight Java...

متن کامل

OpenGL and VTK interface for .NET

VTK (visualization toolkit) is a large and useful object oriented library for data visualization. The current version (4.0) is also distributed for Win32 platform by means of dynamic linked libraries. Its native language is C++. An interface for Java, Python and TCL exists. These languages provide some subset of the VTK functionality only. Therefore the best use is with C++. OpenGL is well know...

متن کامل

Featherweight Java with dynamic and static overloading

We propose FMJ (Featherweight Multi Java), an extension of Featherweight Java with encapsulated multi-methods thus providing dynamic overloading. Multi-methods (collections of overloaded methods associated to the same message, whose selection takes place dynamically instead of statically as in standard overloading) are a useful and flexible mechanism which enhances re-usability and separation o...

متن کامل

Constructive Foundations for Featherweight Java

In this paper we present a recursion-theoretic denotational semantics for Featherweight Java. Our interpretation is based on a formalization of the object model of Castagna, Ghelli and Longo in a predicative theory of types and names. Although this theory is prooftheoretically weak, it allows to prove many properties of programs written in Featherweight Java. This underpins Feferman’s thesis th...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Journal of Object Technology

دوره 7  شماره 

صفحات  -

تاریخ انتشار 2008